<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:ctg="http://www.crotouristguide.com/taglib">

<ui:component>
	<rich:tabPanel width="100%" switchType="ajax">
		<rich:tab label="#{messages['label.weather']}">
			<h:form>
				<a4j:region renderRegionOnly="true">
					<s:div id="weather">
						<table>
							<tr>
								<td colspan="2"><h:selectOneMenu value="#{weather.city}"
									onclick="return false;">
									<f:selectItems value="#{cities}" var="c"></f:selectItems>
									<a4j:support event="onchange" reRender="weather" />
								</h:selectOneMenu></td>
							</tr>
							<tr>
								<td><h:outputLink value="#{application.contextPath}/panels/weather.seam" styleClass="new-window">
									<h:graphicImage alt="#{messages['label.image.alt']}"
										value="http://www.worldweather.org/img_cartoon/pic#{liveWeather.kod}.gif" />
								</h:outputLink></td>
								<td nowrap="nowrap"><h:outputLink value="#{application.contextPath}/weather.seam" styleClass="new-window">
									<h:outputText styleClass="temperature"
										value="#{liveWeather.temperaturaZraka} C" />
									<br />
									<h:outputText value="#{liveWeather.opis}" />
								</h:outputLink></td>
							</tr>
						</table>
					</s:div>
				</a4j:region>
			</h:form>
		</rich:tab>
		<rich:tab label="#{messages['label.exchange.rate']}">

			<table width="100%" cellpadding="0" cellspacing="0">
				<ui:repeat value="#{currencies}" var="currency">
					<tr>
						<td width="40px" ><h:graphicImage
							value="/theme/default/images/flags/#{currency.valuta.oznaka}.png"
							height="11" width="15">
						</h:graphicImage></td>
						<td width="40px" >#{currency.valuta.oznaka}</td>
						<td width="40px" >#{currency.valuta.jedinica}</td>
						<td width="60px" >#{currency.srednji}</td>
					</tr>
				</ui:repeat>
			</table>
		</rich:tab>
	</rich:tabPanel>	
</ui:component>

</html>